local myprint = function(x)
    print("the value is " .. x)
end


function Method(a, b, myprint)
    local result = a + b
    myprint(result)
end

Method(10, 20, myprint)

function MethodArgs(...)
    local args = { ... }
    local result = 0
    for i, x in ipairs(args) do
        result = result + x
    end
    return result
end

local ans = MethodArgs(1, 2, 34, 4, 45, 5)
print("the answer is " .. ans)
